home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / intmail2 / wsinfo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-07-27  |  1.1 KB  |  53 lines

  1. unit wsinfo;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TWSInfoDlg = class(TForm)
  11.     InfoMemo: TMemo;
  12.     ShowButton: TButton;
  13.     procedure ShowButtonClick(Sender: TObject);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   WSInfoDlg: TWSInfoDlg;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27. uses msWSock;
  28.  
  29. procedure TWSInfoDlg.ShowButtonClick(Sender: TObject);
  30. var
  31.   s: string;
  32. begin
  33.   with InfoMemo.Lines, msWinsock.WinsockInfo do
  34.   begin
  35.     Clear;
  36.     Add('Winsock version: $'+IntToHex(Version,4));
  37.     Add('High version: $'+IntToHex(HighVersion,4));
  38.     Add('Description: '+Description);
  39.     Add('System status: '+SystemStatus);
  40.     Add('Maximum sockets: '+IntToStr(MaxSockets));
  41.     Add('Local host: '+msWinsock.LocalName);
  42.     s:=msWinsock.LocalAddress;
  43.     Add('Local address: '+s);
  44.     try
  45.       Add('Local host after reverse lookup: '+msWinsock.msGetHostByAddr(s));
  46.     except
  47.       Add('Unable to perform reverse lookup');
  48.     end;
  49.   end;
  50. end;
  51.  
  52. end.
  53.